<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.joda.org/joda/time/tags" prefix="joda" %>

<c:set var="numberpat" value="######0.0000" />
<!DOCTYPE html>
<html lang="en">
<head>
<%@ include file="../commons/headfiles-jquery.jsp"%>
<link href="../css/apps/monthplanning/get.css" rel="stylesheet"	type="text/css" />
<script type="text/javascript">
	var deptId = '${bean.department.id}' || -1;
	var actionOpr = "${not empty bean.id?'update':'add'}";
</script>

</head>
<body>
	<div class="navbar navbar-fixed-top navbar-inverse">
		<div class="navbar-inner">
			<div class="container-fluid">
				<div class="nav-collapse">
					<a class="brand" href="#">生产月计划</a>
					<button class="btn btn-primary" onclick="saveplain();"
						type="button">
						<i class="icon-ok-sign"></i>保存
					</button>
					<button class="btn btn-success" type="button" onclick="download('${bean.id}')">
						<i class="icon-arrow-down"></i>下载
					</button>
					
					<button class="btn btn-info" type="button" onclick="openforadd()">
						<i class="icon-arrow-down"></i>添加计划项
					</button>
					
					<div class="pull-right">
						<button class="btn btn-danger" type="button" onclick="closeMe();">
							<i class="icon-remove-sign"></i>关闭
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>

	<fieldset style="display: none">
		<legend>计划导入</legend>
		<form action="month-planning!importfileplan" method="post"
			enctype="multipart/form-data">
			日期:<input name="actionDate" id="dpkor" readOnly /> 文件:<input
				type="file" id="file" name="upLoad" /> <input type="submit" />
		</form>
	</fieldset>

	<form id="planform">
		<input type="hidden" name="validating" value="true" /> <input
			type="hidden" name="bean.department.id" value="${bean.department.id}"
			id="deptId" />
		<c:if test="${not empty bean.id}">
			<input type="hidden" name="bean.id" value="${bean.id}" />
			<input type="hidden" name="bean.planType" value="${bean.planType}" />
			<input type="hidden" name="bean.maker.username"
				value="${bean.maker.username}" />
			<input type="hidden" name="bean.draftable" value="false" />
		</c:if>
		<c:if test="${empty bean.id}">
		    <input type="hidden" name="bean.draftable" value="true" />
		</c:if>
		<fieldset>
			<legend>计划选项</legend>

			<div class="input-prepend">
			    <joda:format value="${bean.createDate}" var="cdate" pattern="yyyy-MM-dd"/>
				<span class="add-on">日期</span>
				<input id="cdate" name="bean.createDate" type="text"
					value="${cdate}"
					readOnly />
				<span class="label label-important">如果不选择,则默认为今日下发</span>
			</div>			
		</fieldset>
		<c:set var="gindex" value="0" />
		<%@ include file="plan-proterozoic-details.jsp"%>

		<hr />
		<%@ include file="plan-generated-details.jsp"%>

		<hr />
		<table class="table table-bordered table-hover table-condensed">
			<caption>输入生产计划</caption>
			<thead>
				<tr>
					<th colspan="8">
						<ul id="messages"></ul>
					</th>
				</tr>
				<tr>
					<th width="15%" scope="col">代码</th>
					<th width="15%" scope="col">名称</th>
					<th width="6%" scope="col">单位</th>
					<th width="15%" scope="col">基础数量</th>
					<th>最终量</th>
					<th>修改量</th>
					<th width="15%" scope="col">备注</th>
					<th class="line4" width="2%" scope="col">删</th>
				</tr>
			</thead>
			<tbody id="planBody"></tbody>

		</table>
	</form>
	<script type="text/javascript">
		var gindex = ${gindex + 1}||0;
	</script>
	<script src="../scripts/apps/monthplanning/edit.js"	type="text/javascript"></script>
</body>
</html>